package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Skill数据管理 */
public class SkillDBModel extends AbstractDBModel<SkillDBModel, SkillEntity>
{
    private static SkillDBModel instance;

    public static SkillDBModel getInstance() {
        if (instance == null) {
            instance = new SkillDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Skill.data";
    }

    /** 创建实体 */
    @Override
    protected SkillEntity MakeEntity(GameDataTableParser parse)
    {
        SkillEntity entity = new SkillEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.SkillName = parse.GetFieldValueToUTF8String("SkillName");
        entity.SkillDesc = parse.GetFieldValueToUTF8String("SkillDesc");
        entity.SkillPic = parse.GetFieldValueToUTF8String("SkillPic");
        entity.LevelLimit = parse.GetFieldValueToInt("LevelLimit");
        entity.IsPhyAttack = parse.GetFieldValueToInt("IsPhyAttack");
        entity.AttackTargetCount = parse.GetFieldValueToInt("AttackTargetCount");
        entity.AttackRange = parse.GetFieldValueToFloat("AttackRange");
        entity.AreaAttackRadius = parse.GetFieldValueToFloat("AreaAttackRadius");
        entity.ShowHurtEffectDelaySecond = parse.GetFieldValueToFloat("ShowHurtEffectDelaySecond");
        entity.RedScreen = parse.GetFieldValueToInt("RedScreen");
        entity.AttackState = parse.GetFieldValueToInt("AttackState");
        entity.AbnormalState = parse.GetFieldValueToInt("AbnormalState");
        entity.BuffInfoID = parse.GetFieldValueToInt("BuffInfoID");
        entity.BuffTargetFilter = parse.GetFieldValueToInt("BuffTargetFilter");
        entity.BuffIsPercentage = parse.GetFieldValueToInt("BuffIsPercentage");
        return entity;
    }
}
